package com.ying.common.exception;

import com.ying.common.entity.ResponseCode;

public class BaseException extends RuntimeException {

	private Integer code;
	private String msg;
	private Object data;

	public BaseException(ResponseCode responseCode) {
		super(responseCode.getMsg());
		this.code = responseCode.getCode();
		this.msg = responseCode.getMsg();
	}

	public BaseException(ResponseCode responseCode, Object data) {
		this(responseCode);
		this.data = data;
	}

	public BaseException(Integer code, String msg) {
		super(msg);
		this.code = code;
		this.msg = msg;
	}

	public BaseException(Integer code, String msg, Object data) {
		this(code, msg);
		this.data = data;
	}

	public Integer getCode() {
		return code;
	}

	public void setCode(Integer code) {
		this.code = code;
	}

	public String getMsg() {
		return msg;
	}

	public void setMsg(String msg) {
		this.msg = msg;
	}

	public Object getData() {
		return data;
	}

	public void setData(Object data) {
		this.data = data;
	}
}